package com.wits.qso.dao.impl;

import javax.persistence.Query;

import org.springframework.stereotype.Component;

import com.wits.platform.dao.impl.BaseDaoImpl;
import com.wits.qso.dao.custom.DeptDaoCustom;
import com.wits.qso.entity.Dept;

@Component
public class DeptDaoImpl extends BaseDaoImpl<Dept, String> implements DeptDaoCustom
{

	public Dept findByTitle(String title) {
		Dept result = null;
		try {
			Query query = em.createQuery( "FROM Dept o WHERE o.title = :title" );
			query.setParameter( "title", title );
			
			result = (Dept) query.getSingleResult();
		} catch (Throwable cause) {
		}

		return result;
	}
}
